function hasExoplanet(readings) {
  const lvs = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  let sum = 0;
  for (const char of readings) {
    sum += lvs.indexOf(char);
  }
  const aver = sum / readings.length;
  for (const char of readings) {
    if (lvs.indexOf(char) <= aver*0.8) {
      return true;
    }
  }
  return false;
}


let output = hasExoplanet("665544554");
console.log(output);